﻿namespace EasyCMS.Common
{
    using System;
    using System.Collections.Generic;
    using Pismire;


    [System.ServiceModel.ServiceContractAttribute(ConfigurationName = "EasyCMS.Common.IContents")]
    public interface IContents
    {
        /// <summary>
        /// 当前操作的数据供应源名称
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        string DataProviderName { get; }

        /// <summary>
        /// 当前操作的数据供应源参数
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        string DataProviderArgs { get; }

        /// <summary>
        /// 初始化设置，使用前必须执行
        /// </summary>
        /// <param name="dataProviderName"></param>
        /// <param name="dataProviderArgs"></param>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IContents/Setup", ReplyAction = "http://tempuri.org/IContents/SetupResponse")]
        void Setup(string dataProviderName, string dataProviderArgs);

        /// <summary>
        /// 根据ID获取内容主题数据
        /// </summary>
        /// <param name="categoryID"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IContents/GetByID", ReplyAction = "http://tempuri.org/IContents/GetByIDResponse")]
        EasyCMS.Common.DataComponents.Content GetByID(int id);

        /// <summary>
        /// 查询数据集合
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IContents/GetList", ReplyAction = "http://tempuri.org/IContents/GetListResponse")]
        List<EasyCMS.Common.DataComponents.Content> GetList(EasyCMS.Common.Querys.Content query);

        /// <summary>
        /// 查询数据集合
        /// </summary>
        /// <param name="query"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IContents/GetListFull", ReplyAction = "http://tempuri.org/IContents/GetListFullResponse")]
        List<EasyCMS.Common.DataComponents.Content> GetList(EasyCMS.Common.Querys.Content query, out int recordCount);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IContents/Add", ReplyAction = "http://tempuri.org/IContents/AddResponse")]
        ExcuteState Add(ref EasyCMS.Common.DataComponents.Content content);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IContents/Update", ReplyAction = "http://tempuri.org/IContents/UpdateResponse")]
        ExcuteState Update(ref EasyCMS.Common.DataComponents.Content content);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="categoryID"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IContents/Delete", ReplyAction = "http://tempuri.org/IContents/DeleteResponse")]
        ExcuteState Delete(int id);

        /// <summary>
        /// 创建一个新的内容数据分区表
        /// </summary>
        /// <param name="partitionMark"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IContents/CreateContentTable", ReplyAction = "http://tempuri.org/IContents/CreateContentTableResponse")]
        ExcuteState CreateContentTable(string partitionMark);
    }
}
